package com.lanyou.esb.cook.proxy.redis.persistent;

import com.lanyou.esb.cook.proxy.exception.PersistentDataException;
import com.lanyou.esb.cook.proxy.service.Service;

/**
 * 持久化REDIS数据接口
 * 
 * @author Davey.wu
 */
public interface PersistentRedis<T> {
	/**
	 * 初始化方法
	 * 
	 * @throws Exception
	 */
	void init() throws Exception;

	/**
	 * 销毁方法
	 * 
	 * @throws Exception
	 */
	void destroy() throws Exception;

	/**
	 * 将数据持久化到数据库
	 * 
	 * @throws PersistentDataException
	 * @throws Exception
	 * @throws ParamSetRuntimeException
	 */
	void persistent() throws Exception;

	/**
	 * 获取服务接口
	 * 
	 * @return
	 */
	Service getService();
}
